﻿using Abp.Application.Services.Dto;
using Camc.Quality.ProcessRoute;
using Camc.Quality.StoreManagement.StoreInfo;
using Camc.Quality.TrepanningManager.PrintLabelManager;
using System;
using System.Collections.Generic;
using System.Text;

namespace Camc.Quality.TrepanningManager.MatingManager
{
    /// <summary>
    /// 配套树表格Dto (如果子级和父级字段不一样可扩展)
    /// </summary>
    public class MatingTreeGridDto
    {
        public MatingEditParentData data { get; set; } = new MatingEditParentData();
        public List<MatingDetaillist> children { get; set; } = new List<MatingDetaillist>();
    }

    public class MatingTreeResult
    {
        public List<MatingTreeGridDto> MatingTreeGridList { get; set; }
        #region 工艺路线
        public List<ProcessNodeDto> ProcessNodeList { get; set; }

        public List<ProcessLineDto> ProcessLineList { get; set; }
        /// <summary>
        /// 0成功 1 失败
        /// </summary>
        public int code { get; set; }
        /// <summary>
        /// 新增物料详细
        /// </summary>
      //  public BomMainSelectParentContentListDto materialsContentDto { get; set; }
        public string Message { get; set; }

        #endregion
    }
    public class MatingEditParentData : EntityDto<Guid>
    {
        /// <summary>
        /// 合格证号
        /// </summary>
        public string QualifiedNumber { get; set; }
        /// <summary>
        /// 放行单号
        /// </summary>
        public string ReleaseOrder { get; set; }
        /// <summary>
        /// 汇总id
        /// </summary>
        public Guid? CollectId { get; set; }
        /// <summary>
        /// 层级
        /// </summary>
        public int NodeLevel { get; set; }
        /// <summary>
        /// 火箭型号
        /// </summary>
        public string HJXH { get; set; }
        /// <summary>
        /// 火箭发次
        /// </summary>
        public string HJFC { get; set; }
        /// <summary>
        /// 火箭芯级
        /// </summary>
        public string XJName { get; set; }
        /// <summary>
        /// 火箭部套名称
        /// </summary>
        public string BTName { get; set; }
        /// <summary>
        /// 工步id
        /// </summary>
        public Guid LoadDetailsId { get; set; }
        /// <summary>
        /// 库存主表id
        /// </summary>
        public Guid StoreStockId { get; set; }
        /// <summary>
        /// 产品编号(件号)
        /// </summary>
        public string ProductNumber { get; set; }
        /// <summary>
        /// 物料代码
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        ///物料名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 规格
        /// </summary>
        public string Module { get; set; }
        /// <summary>
        /// 物料层级
        /// </summary>
        public string LevelName { get; set; }
        /// <summary>
        /// 物料层级号
        /// </summary>
        public int LevelNum { get; set; }
        /// <summary>
        /// 物料类别
        /// </summary>
        public string MaterialsNodeName { get; set; }
        /// <summary>
        /// 单位
        /// </summary>
        public string Unit { get; set; }
        /// <summary>
        /// 工艺用量
        /// </summary>
        public int Number { get; set; }
        /// <summary>
        /// 芯级预配套数量
        /// </summary>
        public int PreSuiteStock { get; set; }
        /// <summary>
        /// 可用库存数量
        /// </summary>
        public int UsableQuantityStock { get; set; }
        /// <summary>
        /// 可用预配套数量
        /// </summary>
        public int UsableMatingQuantityStock { get; set; }
        
        /// <summary>
        /// 配套数量
        /// </summary>
        public int SuiteStock { get; set; }
        /// <summary>
        /// 缺料数量
        /// </summary>
        public int StarvingStock { get; set; }
        /// <summary>
        /// 出库数量
        /// </summary>
        public int DeliveryStock { get; set; }
        /// <summary>
        /// 配套状态  0否 1 是
        /// </summary>
        public int IsSuit { get; set; } = 0;
        /// <summary>
        /// 预配套人
        /// </summary>
        public string PreSuiteName { get; set; }
        /// <summary>
        /// 预配套时间
        /// </summary>
        public string PreSuiteTime { get; set; }
        /// <summary>
        /// 配套人
        /// </summary>
        public string CompletePeople { get; set; }
        /// <summary>
        /// 配套时间
        /// </summary>
        public string CompleteTime { get; set; } 
        /// <summary>
        /// 配套状态
        /// </summary>
        public int MatingStatus { get; set; }
        /// <summary>
        /// 配套状态名称
        /// </summary>
        public string MatingStatusName { get; set; }
        /// <summary>
        /// 物料类别名称
        /// </summary>
        public string MaterialsTypeName { get; set; }
        /// <summary>
        /// 库存子表
        /// </summary>
        public List<StoreStockContentDto> StoreContents { get; set; }
        /// <summary>
        /// 装入件明细
        /// </summary>
        public List<PrintLoadEntityDto> printLoadEntityDtos { get; set; } = new List<PrintLoadEntityDto>();
        /// <summary>
        /// 拼接
        /// </summary>
        public string JoinText { get; set; }
        /// <summary>
        /// 所属工步id
        /// </summary>
        public Guid? WorkStepId { get; set; }
        /// <summary>
        /// 年代号
        /// </summary>
        public string YearsNo { get; set; }
        /// <summary>
        /// 合格证数量
        /// </summary>
        public int QualifiedNumberCount { get; set; }
        /// <summary>
        /// 放行单数量
        /// </summary>
        public int ReleaseOrderCount { get; set; }
        /// <summary>
        /// 放行单数量+合格证数量
        /// </summary>
        public string AllNumber { get; set; }
    }
    public class MatingEditChildData 
    {
        /// <summary>
        /// 年代号
        /// </summary>
        public string YearsNo { get; set; }
        /// <summary>
        /// 汇总id
        /// </summary>
        public Guid? CollectId { get; set; }
        /// <summary>
        /// 火箭型号
        /// </summary>
        public string HJXH { get; set; }
        /// <summary>
        /// 火箭发次
        /// </summary>
        public string HJFC { get; set; }
        /// <summary>
        /// 火箭芯级
        /// </summary>
        public string XJName { get; set; }
        /// <summary>
        /// 火箭部套名称
        /// </summary>
        public string BTName { get; set; }
        /// <summary>
        /// 层级
        /// </summary>
        public int NodeLevel { get; set; }
        /// <summary>
        /// 工步id
        /// </summary>
        public Guid LoadDetailsId { get; set; }
        /// <summary>
        /// 库存主表id
        /// </summary>
        public Guid StoreStockId { get; set; }
        public Guid Id { get; set; }
        /// <summary>
        /// 产品编号(件号)
        /// </summary>
        public string ProductNumber { get; set; }
        /// <summary>
        /// 物料代码
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        ///物料名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 规格
        /// </summary>
        public string Module { get; set; }
        /// <summary>
        /// 物料层级
        /// </summary>
        public string LevelName { get; set; }
        /// <summary>
        /// 物料层级号
        /// </summary>
        public int LevelNum { get; set; }
        /// <summary>
        /// 物料类别
        /// </summary>
        public string MaterialsNodeName { get; set; }
        /// <summary>
        /// 单位
        /// </summary>
        public string Unit { get; set; }
        /// <summary>
        /// 工艺用量
        /// </summary>
        public int Number { get; set; }
        /// <summary>
        /// 芯级预配套数量
        /// </summary>
        public int PreSuiteStock { get; set; }
        /// <summary>
        /// 可用预配套数量
        /// </summary>
        public int UsableQuantityStock { get; set; }
        /// <summary>
        /// 可用预配套数量
        /// </summary>
        public int UsableMatingQuantityStock { get; set; }
        /// <summary>
        /// 配套数量
        /// </summary>
        public int SuiteStock { get; set; }
        /// <summary>
        /// 缺料数量
        /// </summary>
        public int StarvingStock { get; set; }
        /// <summary>
        /// 出库数量
        /// </summary>
        public int DeliveryStock { get; set; }
        /// <summary>
        /// 配套状态  0否 1 是
        /// </summary>
        public int IsSuit { get; set; } = 0;
        /// <summary>
        /// 预配套人
        /// </summary>
        public string PreSuiteName { get; set; }
        /// <summary>
        /// 预配套时间
        /// </summary>
        public string PreSuiteTime { get; set; } 
        /// <summary>
        /// 配套人
        /// </summary>
        public string CompletePeople { get; set; }
        /// <summary>
        /// 配套时间
        /// </summary>
        public string CompleteTime { get; set; }
        /// <summary>
        /// 配套状态
        /// </summary>
        public int MatingStatus { get; set; }
        /// <summary>
        /// 配套状态名称
        /// </summary>
        public string MatingStatusName { get; set; }
        /// <summary>
        /// 物料类别名称
        /// </summary>
        public string MaterialsTypeName { get; set; }
        /// <summary>
        /// 库存子表
        /// </summary>
        public List<StoreStockContentDto> StoreContents { get; set; }
        /// <summary>
        /// 拼接
        /// </summary>
        public string JoinText { get; set; }
        /// <summary>
        /// 所属工步id
        /// </summary>
        public Guid? WorkStepId { get; set; }
    }
    public class MatingDetaillist
    {
        public MatingEditChildData data { get; set; }
        public List<MatingDetaillist> children { get; set; }
    }
}
